<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of App_Public_Controller_User
 *
 * @author Zelic
 */
class App_Public_Controller_User extends App_Public_Controller{
    function login($data){
        if ($data!=null){
            $result = $this->model->select(array('fields'=>'username, password', 'where'=>'username="'.$data['username'].'" AND password="'.md5($data['password']).'"'));
            if ($result!=null){
                Lib_Session::set("access", "true");
                $this->redirect("index");
            }
        }
    }
    
    function logout(){
        Lib_Session::stop();
    }
}

?>
